load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "sqlstats",
    srcs = ["sqlstats.go"],
    importpath = "github.com/cockroachdb/cockroach/pkg/workload/sqlstats",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/workload",
        "//pkg/workload/histogram",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_spf13_pflag//:pflag",
        "@org_golang_x_exp//rand",
    ],
)

go_test(
    name = "sqlstats_test",
    srcs = [
        "main_test.go",
        "sqlstats_test.go",
    ],
    embed = [":sqlstats"],
    deps = [
        "//pkg/base",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "//pkg/workload",
        "@com_github_stretchr_testify//require",
    ],
)
